package cn.tedu.travelsystem.travelDownload.service.impl;

import cn.tedu.travelsystem.travelDownload.mapper.UserAvatarMapper;
import cn.tedu.travelsystem.travelDownload.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {

    private final UserAvatarMapper userMapper;

    public UserServiceImpl(UserAvatarMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    @Transactional
    public String updateUserAvatar(Integer userId, String avatarPath) {
        userMapper.updateAvatar(userId, avatarPath);
        return avatarPath; // 返回存储后的路径
    }
}